package buildernodirector;

/**
 * @author 赵希奥
 * @date 2022/3/17 0:39
 * @gitHub https://github.com/CKXGZXA
 * @gitee https://gitee.com/ckxgzxa
 * @description: 汽车建造者, 充当抽象建造者
 */
public abstract class CarBuilder {
    protected static Car car = new Car();

    public abstract void buildBrand();
    public abstract void buildTire();
    public abstract void buildEngine();
    public abstract void buildSteeringWheel();


    public static Car construct(CarBuilder builder) {
        builder.buildBrand();
        builder.buildTire();
        builder.buildEngine();
        builder.buildSteeringWheel();
        return car;
    }
}
